package com.my.attendance.service;

import com.my.attendance.dao.EmployeeDao;
import com.my.attendance.entity.Employee;
import com.my.attendance.entity.EmployeeDTO;
//import com.my.attendance.entity.EmployeeDTO;

import java.util.List;

public class EmployeeService {
    private EmployeeDao employeeDao=new EmployeeDao();

    public List<EmployeeDTO> getEmployeePageList(int pageNo) throws Exception {
        List<EmployeeDTO> employeePageList = employeeDao.getEmployeePageList(pageNo);
        return employeePageList;
    }

    public int getCount() throws Exception {
        int count = employeeDao.getCount();
        return count;
    }

    public int getEmployee_number() throws Exception {
        int employee_number = employeeDao.getEmployee_number();
        return employee_number;
    }

    public int addEmployee(Employee employee) throws Exception {
        int i = employeeDao.addEmployee(employee);
        return i;
    }

    public Employee getEmployee(int id) throws Exception {
        Employee employee = employeeDao.getEmployee(id);
        return employee;
    }

    public int updateEmployee(Employee employee) throws Exception {
        int i = employeeDao.updateEmployee(employee);
        return i;
    }

    public int deleteEmployee(int id) throws Exception {
        int i = employeeDao.deleteEmployee(id);
        return i;
    }
}
